﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title>User</title>
    <script type="text/javascript">
        $(document).ready(function () {
            //修正选择显示条数时不能绑定选择的值
            $("#numPerPageSelect").val($("#numPerPage").val());
        });
    </script>
</head>
<body>
    <div class="pageHeader">
        <form id="pagerForm" onsubmit="return navTabSearch(this);" action="/Sys/User" method="post">
        <!--引入公共分页html-->
        <!--#include file="/Views/Shared/Pager.htm"-->
        <input type="hidden" name="orderField" value="<%=ViewData["orderField"] %>" />
        <input type="hidden" name="orderDirection" value="<%=ViewData["orderDirection"] %>" />
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        用户名：<input type="text" name="username" value="<%=ViewData["username"] %>" />
                    </td>
                    <td>工号：<input type="text" name="jobno" value="<%=ViewData["jobno"] %>" /></td>
                    <%--<td>
                        <select class="combox" name="province">
                            <option value="">所有省市</option>
                            <option value="北京">北京</option>
                            <option value="上海">上海</option>
                            <option value="天津">天津</option>
                            <option value="重庆">重庆</option>
                            <option value="广东">广东</option>
                        </select>
                    </td>
                    <td>
                        建档日期：<input type="text" class="date" readonly="readonly" />
                    </td>--%>
                </tr>
            </table>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button></div>
                        </div>
                    </li>
                    <li><a class="button" href="/Sys/UserSearch" target="dialog" width="450" mask="true"
                        title="高级检索"><span>高级检索</span></a></li>
                </ul>
            </div>
        </div>
        </form>
    </div>
    <div class="pageContent">
        <div class="panelBar">
            <ul class="toolBar">
                <li><a class="add" href="/Sys/UserAdd" target="dialog" title="添加用户" mask="true">
                    <span>添加</span></a></li>
                <li><a class="edit" href="/Sys/UserEdit?id={sid_user}" target="dialog"><span>修改</span></a></li>
                <li><a class="delete" href="/Sys/UserDelete" title="确实要删除这些记录吗?"
                    target="selectedTodo" rel="ids"><span>批量删除</span></a></li>
                <li class="line">line</li>
                <li><a class="icon" href="/Sys/UserExport" target="dwzExport" targettype="dialog"
                    title="确定要导出这些记录吗?"><span>导出EXCEL</span></a></li>
            </ul>
        </div>
        <table class="table" width="100%" layouth="138">
            <thead>
                <tr>
                    <th width="22">
                        <input type="checkbox" group="ids" class="checkboxCtrl" />
                    </th>
                    <th width="80" orderfield="id" class="<%=ViewData["orderDirection"]==""?"asc":ViewData["orderDirection"] %>">
                        序号
                    </th>
                    <th width="100">
                        用户名
                    </th>
                    <th width="100">
                        工号
                    </th>
                    <th width="100">
                        邮箱
                    </th>
                    <th width="100">
                        电话
                    </th>
                    <th width="30">
                        是否可用
                    </th>
                    <th width="100">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <%foreach (System.Data.DataRow row in (ViewData["user"] as System.Data.DataTable).Rows)
                  {%>
                <tr target="sid_user" rel='<%=row["id"] %>'>
                    <td>
                        <input name="ids" value='<%=row["id"] %>' type="checkbox">
                    </td>
                    <td>
                        <%=row["id"]%>
                    </td>
                    <td>
                        <%=row["username"]%>
                    </td>
                    <td>
                        <%=row["jobno"]%>
                    </td>
                    <td>
                        <%=row["email"]%>
                    </td>
                    <td>
                        <%=row["phone"]%>
                    </td>
                    <td>
                        <%=row["isenable"].ToString().ToLower() == "true" ? "是" : "否"%>
                    </td>
                    <td>
                        <a title="编辑用户" target="dialog" href='/Sys/UserEdit?id=<%=row["id"] %>' class="btnEdit">
                            编辑</a> <a title="确定重置密码?" target="ajaxTodo" href='/Sys/ResetPassword?id=<%=row["id"] %>'
                                class="btnView">重置密码</a> <a title="确定要删除吗?" target="ajaxTodo" href='/Sys/UserDelete?ids=<%=row["id"] %>'
                                    class="btnDel">删除</a>
                    </td>
                </tr>
                <%} %>
            </tbody>
        </table>
        <div class="panelBar">
            <div class="pages">
                <span>显示</span>
                <select class="combox" id="numPerPageSelect" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                    <option value="20">20</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                    <option value="200">200</option>
                </select>
                <span>条，共&nbsp;<b><%=ViewData["rowTotal"]%></b>&nbsp;条记录</span>
            </div>
            <div class="pagination" targettype="navTab" totalcount="<%=ViewData["rowTotal"] %>"
                numperpage="<%=ViewData["pageSize"] %>" pagenumshown="10" currentpage="<%=ViewData["pageIndex"] %>">
            </div>
        </div>
    </div>
</body>
</html>
